package com.cy.pj.common.pojo;

public class JsonResult {
    private Integer state=1;
    private String message="ok";
    private Object data;
    public JsonResult(){}
    public JsonResult(String message){
        this.message=message;
    }
    public JsonResult(Integer state, String message){
        this.state=state;
        this.message=message;
    }
    public JsonResult(Object data){
        this.data=data;
    }
    //封装异常：
    public JsonResult(Throwable exception){
        this(0,exception.getMessage());
    }

    public Integer getState() {
        return state;
    }

    public void setState(Integer state) {
        this.state = state;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }
}
